package com.hymall.mapper;

import com.hymall.bean.MarketCart;
import com.hymall.bean.MarketGoods;
import com.hymall.bean.MarketGoodsProduct;
import com.hymall.bean.bo.WxCartCheckoutBO;
import com.hymall.bean.vo.WxCartJudgeVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public interface WxCartMapper {
    MarketGoods selectGoodsById(Integer goodsId);

    MarketGoodsProduct selectGoodsProductById(Integer productId);

    int insertCart(@Param("date") Date date, @Param("deleted") Boolean deleted, @Param("userId") Integer userId, @Param("goods") MarketGoods marketGoods, @Param("product") MarketGoodsProduct product, @Param("number") Integer number);

    Integer selectAddressIsDefaultId(Integer userId);

    Integer selectCartAvailableCoupon(Integer userId);

    BigDecimal selectCheckedGoodsSumPrice(@Param("userId") Integer userId);

    BigDecimal selectDiscountByCouponId(Integer couponId);

    List<MarketCart> selectCheckedGoods(Integer userId);

    List<MarketCart> selectGoodsByCartId(Integer userId, Integer cartId);

    int insertCartFastAdd(@Param("date") Date date, @Param("deleted") boolean deleted, @Param("userId") Integer userId, @Param("goods") MarketGoods marketGoods, @Param("product") MarketGoodsProduct product, @Param("number") Integer number);

    WxCartJudgeVO selectCartDeletedById(Integer cartId);

    BigDecimal selectFastAddGoodsSumPrice(@Param("userId") Integer userId, @Param("cartId") Integer cartId);

    BigDecimal selectDiscountByCouponIdZero(Integer userId);
}
